package demo_10_11_01;

import java.util.Scanner;

public class work_08 {
    public static void main(String[] args) {
       StringBuilder str = new StringBuilder();
        Scanner sc = new Scanner(System.in);
       while (true){
           String s = sc.next();
           str.append(s);
           if(str.length()>6)
               break;
       }

       int ret = 0;
        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i)=='a')
                ret++;
        }
        System.out.println(ret);

    }
}
